import request from '@/utils/request.js'

export default {
  // 获取用户打卡信息
  async getLongLat(data) {
    return await request({
      url: '/personnel/KaoqinNew/get_long_lat',
      data: data,
      method: 'POST',
    })
  },

  // 获取是否有打卡记录
  async getClockRecord(data) {
    return await request({
      url: '/personnel/KaoqinNew/is_clock',
      data: data,
      method: 'POST',
    })
  },

  // 新增打卡
  async addClockRecord(data) {
    return await request({
      url: '/personnel/KaoqinNew/clock_add',
      data: data,
      method: 'POST',
    })
  },

  // 个人月打卡统计
  async getWorkerMonth(data) {
    return await request({
      url: '/personnel/KaoqinNew/worker_clock_month',
      data: data,
      method: 'POST',
    })
  },

  // 个人月考勤审批记录
  async getLeaveMonth(data) {
    return await request({
      url: '/personnel/KaoqinNew/worker_leave_month',
      data: data,
      method: 'POST',
    })
  },

  //获取当日考勤打卡记录
  async getDayRecord(data) {
    return await request({
      url: '/Index/Kaoqin/worker_clock_detail',
      data: data,
      method: 'POST',
    })
  },

  // 删除基础照片
  async rlsbDelete(data) {
    return await request({
      url: '/personnel/KaoqinNew/rlsb_upload_delete',
      data: data,
      method: 'POST',
    })
  },

  // 第一次人脸检测
  async faceCheck(data) {
    return await request({
      url: '/api/face-recognition/check?path=' + data,
      method: 'GET',
      data: data,
      channel: 4,
    })
  },

  // 人脸比对
  async faceRlsb(data) {
    return await request({
      url: `/api/face-recognition/rlsb?file1=${data.file1}&file2=${data.file2}`,
      method: 'GET',
      channel: 4,
    })
  },
  // h5端人脸对比
  async hwfaceRlsb(data) {
    return await request({
      url: `/api/face-recognition/rlsb?file1=${data.file1}&file2=${data.file2}`,
      method: 'GET',
      channel: 4,
    })
  },
  // 更换人脸
  async Setupdatebaseface(data) {
    return await request({
      url: `/index/Kaoqin/update_base_face`,
      method: 'POST',
      data,
    })
  },
  // 获取外勤打卡数据
  async ClicktempClock(data) {
    return await request({
      url: '/personnel/KaoqinNew/temp_clock',
      method: 'POST',
      data,
    })
  },
}
